/*************************************************************************
	> File Name: main.cc
	> Author: Joker
	> Mail: mahongtao@foxmail.com 
	> Created Time: 2020-09-22 11:09:49
 ************************************************************************/

#include "Composite.h"

#include <iostream>
using namespace std;
 
void test0(){
    Leaf * pLeaf1 = new Leaf();
    Leaf * pLeaf2 = new Leaf();

    Composite * pComposite = new Composite();
    pComposite->ADD(pLeaf1);
    pComposite->ADD(pLeaf2);
    pComposite->Operation();
    pComposite->GetChild(2)->Operation();

    delete pComposite;
}

int main(int argc,char *argv[])
{
    test0();
    return 0;
}
